It is often necessary to apply enhancement techniques to images. Enhancement may be desirable to improve the appearance of an image for a human observer, or may be required to make the image more suitable for further processing.
An image may suffer from low contrast. The low contrast can result, for example, from poor matching of sensor dynamic range to object illumination, lack of dynamic range in a sensor with which the image was captured, or incorrect settings of the sensor. Even when automatic gain control techniques are used, an image may exhibit a low dynamic range. This may result from system users seeking to ensure that the maximum range of a display device is not exceeded.
An image with low contrast may appear murky and uninteresting to an observer. Where the image is an input to image analysis techniques such as recognition or feature extraction, the low contrast may limit the effectiveness of the image analysis.
FIG. 1 shows an example of an image 100 having low contrast. The image 100 shows a skin lesion 110 and an area of surrounding skin 120. The lesion 110 is to be analysed for the possible presence of malignant melanoma. Techniques to be applied to the image 100 include image segmentation into regions designated ‘lesion’ and ‘non-lesion’ and subsequent extraction of features relating to colour, shape, texture and symmetry of the lesion 110. The areas 130 in the corner of the image 100 are regions of standard colour for use in calibration of the image 100. The image 100 is described in RGB colour space in which the value of each pixel is defined by the (R, G, B) triplet where R is the red component, G is the green component and B is the blue component of the pixel colour. Typically, each colour component is stored as 8 bits, providing a range of [0,255] for each colour. Although image 100 is a colour image, it is illustrated in FIG. 1 as a grey-scale image for ease of reproduction.
A convenient measure of intensity or luminance is:intensity=⅓(R+G+B)
FIG. 2 shows a histogram 200 of the intensity values of the pixels of the image 100 shown in FIG. 1. The x-axis 210 of the histogram 200 covers the full range of intensity values [0,255]. The y-axis 220 of the histogram 200 shows the number of pixels in the image 100 having the corresponding intensity shown on the x-axis 210. It may be seen that the histogram 200 only covers about two thirds of the full range of intensity values and that most of the intensity values fall in the range from about 100 to 127.
A known technique for enhancing the contrast of an image is histogram stretching. While it would be possible to apply histogram stretching to each of the three colour components R, G and B, the resultant change in the relative proportion of each colour would give unacceptable results. Instead, it is common to apply histogram stretching to the intensity component of the image, as defined above.
FIG. 3 shows a flow chart of a conventional image enhancement technique using histogram stretching. The input to the method is an image 300 defined in RGB colour space. In method step 310 the image 300 is converted from RGB space to HSI colour space.
In the HSI colour model, each pixel of the image is defined in terms of Hue (H), Saturation (S) and Intensity (I). The hue is a colour attribute that describes a pure colour such as red, and the saturation is a measure of the extent to which the pure colour is diluted by white light. The hue and saturation components are closely related to the ways in which a human observer perceives colour. One of the main advantages of working with the HSI colour model is that the intensity component is decoupled from the colour information in an image, in contrast with models such as the RGB colour space.
The result of method step 310 is a description 320 of the image in HSI space.
In step 330 histogram stretching is performed on the intensity component of the image description 320. Each element of the intensity histogram is mapped to an output element by means of a predefined transform. The result is to spread the intensity histogram over the entire range [0,255].
In step 340 the intensity component of the image description 320 is replaced with the intensity component as stretched in step 330.
In step 350 the image is converted back into RGB space, yielding the enhanced image 360. The image 360 may be displayed on a suitable display device or may be used as an input to further processing.
FIGS. 4 and 5 illustrate the method of FIG. 3 as applied to the image 100 shown in FIG. 1. FIG. 4 shows the enhanced image 400. A comparison with FIG. 1 shows that the enhanced image 400 has greater luminance than the image 100 and has a greater dynamic range. Although image 400 is a colour image, it is illustrated in FIG. 4 as a grey-scale image for ease of reproduction
This is further illustrated in FIG. 5, which shows an intensity histogram 500 corresponding to the enhanced image 400. The x-axis 210 covers the full dynamic range [0,255] and the y-axis 520 shows the number of pixels in image 400 having a particular intensity value. A comparison of the histogram 500 and the histogram 200 shows that the intensity has been shifted towards the bright end of the scale and covers the entire dynamic range.
Histogram stretching has certain drawbacks. The increase in dynamic range may cause false contours in the image because the stretched histogram contains gaps where there are missing grey levels. This is illustrated in FIGS. 6 and 7. FIG. 6 shows a detail 600 of the histogram 200 corresponding to the input image 100. The x-axis 610 only covers a portion of the full dynamic range. The y-axis 620 shows the number of pixels in the image 100 having the indicated intensity.
FIG. 7 shows a detail 700 of the histogram 500 corresponding to the enhanced image 400. The x-axis of 710 of histogram 700 only shows the range of intensity values from 140 to 162. It may be seen that the histogram 700 contains gaps. The gaps mean that the histogram 700 contains many false local extrema. This may cause problems in automatic processing of the image or the histogram, for example in a search for a global maximum or global minimum.
A known variation of histogram stretch methods is histogram equalisation. Details may be found in textbooks such as ‘The Image Processing Handbook’ by John C. Russ (3rd edition, CRC Press 1999). Histogram equalisation gives the best visible results in HSI colour space when only histograms of intensity and saturation are manipulated since the human eye is highly sensitive to changes in hue.
There is thus a need for a technique to enhance the contrast of an image while avoiding shortcomings of the histogram stretching methods.